package com.example.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.text.DateFormat;
import java.util.Date;

@Controller
public class HomeController {

    @RequestMapping("/home")
    public String hello(Model m){
        m.addAttribute("now",DateFormat.getDateTimeInstance().format(new Date()));
        return "index";  //视图重定向index.jsp
    }
}